-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chrome parallel-group-params-mismatch error #518
Comments
I came to ask this same question. My test jobs failed this morning with the same issue. I'm not sure what weird stars aligning behavior had to happen to make chrome 99 available while spinning up my runners this morning, but I'm sure it's related to how github caches packages from apt or something. I don't know if we can have a deterministic set of dependencies in gha when setting up parallel boxes... but really I'd rather this be a gha solve, but specifying browser version would be a decent work around for us failing that |
We had the same issue this morning with our Cypress suites running on Github Actions. As a temporary workaround, we have switched to Electron browser to unblock teams. |
For information the situation solved itself after a day or two but it is still happening sometimes, like today for a mismatch between Chrome 101 and Chrome 102 |
Also looking into this issue today. It seems that whenever Chrome releases a new browser version there is a period of time where Github's runners install can run both the old and new versions and Github is in the process of updating chrome this week it looks like. I was able to modify the script from this comment to ensure that Github is always running the latest stable version of Chrome from Google. Luckily downloading the new Chrome version is only ~10-20 seconds so it doesn't add too much time to our CI runs if one worker isn't up to date. Bash Script #!/bin/bash
# Copied and modified from: https://github.com/actions/virtual-environments/issues/5651#issuecomment-1142075171
# Used to ensure that Cypress tests are always using the latest version of Chrome.
# This is important because sometimes when Chrome releases a new version, Github Action runners can run the
# previous version or the new version and when sharding the tests to run in parallel results in this error:
# https://github.com/cypress-io/github-action/issues/518
download_with_retries() {
# Due to restrictions of bash functions, positional arguments are used here.
# In case if you using latest argument NAME, you should also set value to all previous parameters.
# Example: download_with_retries $ANDROID_SDK_URL "." "android_sdk.zip"
local URL="$1"
local DEST="${2:-.}"
local NAME="${3:-${URL##*/}}"
local COMPRESSED="$4"
if [[ $COMPRESSED == "compressed" ]]; then
local COMMAND="curl $URL -4 -sL --compressed -o '$DEST/$NAME' -w '%{http_code}'"
else
local COMMAND="curl $URL -4 -sL -o '$DEST/$NAME' -w '%{http_code}'"
fi
echo "Downloading '$URL' to '${DEST}/${NAME}'..."
retries=20
interval=30
while [ $retries -gt 0 ]; do
((retries--))
# Temporary disable exit on error to retry on non-zero exit code
set +e
http_code=$(eval $COMMAND)
exit_code=$?
if [ $http_code -eq 200 ] && [ $exit_code -eq 0 ]; then
echo "Download completed"
return 0
else
echo "Error — Either HTTP response code for '$URL' is wrong - '$http_code' or exit code is not 0 - '$exit_code'. Waiting $interval seconds before the next attempt, $retries attempts left"
sleep $interval
fi
# Enable exit on error back
set -e
done
echo "Could not download $URL"
return 1
}
INSTALLED_CHROME_VERSION=$(google-chrome --product-version)
INSTALLED_CHROME_VERSION=${INSTALLED_CHROME_VERSION%.*}
INSTALLED_CHROME_MAJOR_VERSION=$(echo $INSTALLED_CHROME_VERSION | cut -d. -f1)
# Determine latest release of chromedriver
# Compatibility of Google Chrome and Chromedriver: https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection
LATEST_VERSION_URL="https://chromedriver.storage.googleapis.com/LATEST_RELEASE"
echo "Fetching latest chromedriver version from: $LATEST_VERSION_URL"
LATEST_CHROMEDRIVER_VERSION=$(curl "$LATEST_VERSION_URL")
LATEST_CHROMEDRIVER_MAJOR_VERSION=$(echo $LATEST_CHROMEDRIVER_VERSION | cut -d. -f1)
echo "Installed Chrome Version: $INSTALLED_CHROME_VERSION"
echo "Latest ChromeDriver Version: $LATEST_CHROMEDRIVER_VERSION"
if [ "$INSTALLED_CHROME_MAJOR_VERSION" == "$LATEST_CHROMEDRIVER_MAJOR_VERSION" ]; then
echo "The latest major version of Chrome is already installed."
exit 0
fi
# Download and install Google Chrome
CHROME_DEB_URL="https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
CHROME_DEB_NAME="google-chrome-stable_current_amd64.deb"
download_with_retries $CHROME_DEB_URL "/tmp" "${CHROME_DEB_NAME}"
sudo apt install "/tmp/${CHROME_DEB_NAME}" -f
# Download and unpack latest release of chromedriver
echo "Downloading chromedriver v$LATEST_CHROMEDRIVER_VERSION..."
wget "https://chromedriver.storage.googleapis.com/$LATEST_CHROMEDRIVER_VERSION/chromedriver_linux64.zip"
unzip chromedriver_linux64.zip
rm chromedriver_linux64.zip
CHROMEDRIVER_DIR="/usr/local/share/chrome_driver"
CHROMEDRIVER_BIN="$CHROMEDRIVER_DIR/chromedriver"
sudo rm -rf $CHROMEDRIVER_DIR/*
sudo rm -rf $CHROMEDRIVER_BIN/*
sudo mkdir -p $CHROMEDRIVER_DIR
sudo mv "chromedriver" $CHROMEDRIVER_BIN
sudo chmod +x $CHROMEDRIVER_BIN
chromedriver --version |
@codybrouwers I think you meant in your Bash Script - sleep 30
+ sleep $interval |
I really hope Cypress can take this issue seriously. Having stable non-flaky test is 50% good-running CI... |
I solved this problem by avoiding the browser bundled with GitHub Actions. Basically, I install the latest version of chromium and just use that. Here's what that code looks like in our GitHub action. If the Cypress team doesn't want to update the action itself to handle this mismatch, it might make sense to provide some examples in the documentation for how to avoid this problem! - uses: browser-actions/setup-chrome@latest
- run: |
echo "BROWSER_PATH=$(which chrome)" >> $GITHUB_ENV
- name: Run Cypress tests 🚀
uses: cypress-io/github-action@v4
with:
install: false
record: true
parallel: true
browser: "${{ env.BROWSER_PATH }}"
start: "your start command"
env:
CYPRESS_RECORD_KEY: ${{ secrets.recordKey }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN } |
@paulzakin Thanks for the tip! Are you running your tests in a matrix strategy? |
Nope - what you see is what you get in terms of config :) It's worked very well thus far though. Haven't had any problems since I've posted this! |
cf cypress-io/github-action#518 (comment) to fix `In order to run in parallel mode each machine must send identical environment` cf https://github.com/openwhyd/openwhyd/actions/runs/5727380577/job/15519662261?pr=644#step:10:127
This workaround has worked like a charm for a while #518 (comment) But now Test Replay is live and was disappointed to see this So we either:
We'll hopefully have someone from cypress finally look into this |
@a8trejo, the custom chrome issue came up internally earlier today as well. We have a change in place on the Cloud side that should allow this through. Would you mind updating this thread after you've tried another run? I believe your previous run will just indicate that Test Replay is not available (as the replay data was not captured). New runs, however, should be captured (though there may be some limits, depending on the browser name we detect). |
The stdout
As a side note, I also implemented this suggestion for videos, not sure if that's what's breaking it, I can access the retried screenshots and videos just fine |
@a8trejo, is the above screenshot with the new message for a new run or the original one you posted? My understanding of the change is that we'd need a new run to capture the replay (since it originally didn't upload due to the custom chrome being handled as though it was unsupported). |
that was a new run from 30 minutes ago @rockhold |
Please note also related issues:
and the README: parallel documentation:
If there is a need to follow up about the custom Chrome issue, and this can't be resolved soon, then I suggest to open a new issue in https://github.com/cypress-io/cypress/issues as Test Replay is not part of |
I have resubmitted an enhancement request to GitHub in a different place. In the community board, which is where enhancement requests for the GitHub runners are supposed to go, there was no response during the last months. The GitHub runner team say that they have discussed this issue now. See actions/runner#2812 (comment). |
The GitHub runner team have written in actions/runner#2812 (comment) that there are no plans to make changes in this area in the short- or medium-term which would ensure that containers in the same job would not use mixed runner images. 🙁 The enhancement request https://github.com/orgs/community/discussions/52956 remains on the GitHub Community board for the attention of GitHub Product Management. Given that this request has already been open for five months without any Product Management feedback, I'm not hopeful for any change there. In the meantime, as far as Cypress recording to Cypress Cloud is concerned, the recommendation continues unchanged in README: parallel to use a Docker image to ensure that fixed, consistent, browser versions are being used (see also #518 (comment) ^^). |
I suggest to close this issue now as all possible steps have now been addressed by The best advice to avoid the issue is to use a Docker image as mentioned above ^^ in #518 (comment). |
We use parallelized actions with
browser: chrome
, it worked well until yesterday. Now sometimes (not always) we have this behavior :A first container starts with apparently Chrome 98 :
The other containers start a minute later and show us this error :
It says the specs mismatch, I guess it is because of the Chrome version here being Chrome 99 ?
So only 1 container (the first starting) goes ✅ and the others fail like above ❌
The configuration of our Github Action is like this :
I don't see a way of specifying a particular browser version with this action, am I missing something ?
The text was updated successfully, but these errors were encountered: